package com.xiaominfo.oss.module.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author lien
 * @Date 2019/12/24 17:06
 * @Description App对象详情
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "oss_app_info")
public class OSSAppInfo extends Model<OSSAppInfo> {

    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.UUID)
    private String id;

    /**
     * app名称
     */
    private String name;

    /**
     * app项目code
     */
    private String code;

    /**
     * app描述信息
     */
    private String intro;

    /**
     * 开发者id
     */
    @TableField(value = "dev_id")
    private String devId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private String createTime;


    /**
     * 使用空间（字节）
     */
    @TableField(value = "use_space")
    private long useSpace;

    /**
     * 使用空间（字符串）
     */
    @TableField(value = "use_space_str")
    private String useSpaceStr;

    @Override
    protected Serializable pkVal() {
        return id;
    }

    public OSSAppInfo(String id, long useSpace, String useSpaceStr) {
        this.id = id;
        this.useSpace = useSpace;
        this.useSpaceStr = useSpaceStr;
    }
}
